Smoothed Analysis of Binary Search Trees and Quicksort under Additive Noise

نویسندگان

  • Bodo Manthey
  • Till Tantau
چکیده

Binary search trees are a fundamental data structure and their height plays a key role in the analysis of divide-and-conquer algorithms like quicksort. Their worst-case height is linear; their average height, whose exact value is one of the best-studied problems in average-case complexity, is logarithmic. We analyze their smoothed height under additive noise: An adversary chooses a sequence of n real numbers in the range [0, 1]; each number is individually perturbed by adding a random value from an interval of size d; and the resulting numbers are inserted into a search tree. The expected height of this tree is called smoothed tree height. If d is very small, namely for d ≤ 1/n, the smoothed tree height is the same as the worst-case height; if d is very large, the smoothed tree height approaches the logarithmic average-case height. An analysis of what happens between these extremes lies at the heart of our paper: We prove that the smoothed height of binary search trees is Θ( √ n/d + logn), where d ≥ 1/n may depend on n. This implies that the logarithmic average-case height becomes manifest only for d ∈ Ω(n/ log n). For the analysis, we first prove that the smoothed number of left-to-right maxima in a sequence is also Θ( √ n/d+logn). We apply these findings to the performance of the quicksort algorithm, which needs Θ(n) comparisons in the worst case and Θ(n logn) on average, and prove that the smoothed number of comparisons made by quicksort is Θ ( n d+1 √

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Smoothed Analysis of Binary Search Trees

Binary search trees are one of the most fundamental data structures. While the height of such a tree may be linear in the worst case, the average height with respect to the uniform distribution is only logarithmic. The exact value is one of the best studied problems in average-case complexity. We investigate what happens in between by analysing the smoothed height of binary search trees: Random...

متن کامل

Smoothed Analysis of the Height of Binary Search Trees

Binary search trees are one of the most fundamental data structures. While the height of such a tree may be linear in the worst case, the average height with respect to the uniform distribution is only logarithmic. The exact value is one of the best studied problems in average case complexity. We investigate what happens in between by analysing the smoothed height of binary search trees: random...

متن کامل

Verified Analysis of Random Trees

This work is a case study of the formal verification and complexity analysis of some famous probabilistic algorithms and data structures in the proof assistant Isabelle/HOL: the expected number of comparisons in randomised quicksort, the relationship between randomised quicksort and average-case deterministic quicksort, the expected shape of an unbalanced random Binary Search Tree, and the expe...

متن کامل

An asymptotic theory for Cauchy-Euler differential equations with applications to the analysis of algorithms

Cauchy–Euler differential equations surfaced naturally in a number of sorting and searching problems, notably in quicksort and binary search trees and their variations. Asymptotics of coefficients of functions satisfying such equations has been studied for several special cases in the literature. We study in this paper a very general framework for Cauchy–Euler equations and propose an asymptoti...

متن کامل

Exercise Sheet 3 - Master Solution Exercise 1 - Comparisons in Quicksort

Exercise 1 Comparisons in Quicksort To begin with, note that when we talk about the ’number of comparisons’, we mean the number of times one element is compared to another element of the sequence to sort. We do not count internal comparisons of the algorithm (like when the algorithm compares the index of an element to another index). Let a, b be two distinct elements of rank i and j, respective...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electronic Colloquium on Computational Complexity (ECCC)

دوره 14  شماره 

صفحات  -

تاریخ انتشار 2007